﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Luna
{
	public class GenericComparer<T>: IComparer<T> where T: class
	{
		private Comparison<T> c;

		public GenericComparer(Comparison<T> comparison) {
			if (comparison == null)
				throw new ArgumentNullException("comparison");
			c = comparison;
		}

		#region IComparer<T> Members

		public int Compare(T x, T y) {
			return c(x, y);
		}

		#endregion
	}
}
